import vue from '@vitejs/plugin-vue'
import {defineConfig, loadEnv} from "vite";

export default ({command, mode}) => {
  const envConfig = loadEnv(mode, './');
  let config = {
    base: './',
    plugins: [vue()],

    server: {
      host: envConfig.VITE_HOST,
      port: envConfig.VITE_PORT,
      // 是否自动在浏览器打开
      open: true,
      // 是否开启 https
      https: false
    },
  };

  return defineConfig(config)
}